package com.example.messagemodule.adapter;

import android.annotation.SuppressLint;
import android.graphics.Color;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.messagemodule.R;
import com.example.messagemodule.entity.SelectEntity;

import java.util.ArrayList;
import java.util.List;

public class SelectAdapter extends BaseQuickAdapter<SelectEntity, BaseViewHolder> {
    public SelectAdapter(@Nullable ArrayList<SelectEntity> data) {
        super(R.layout.message_select_item, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, SelectEntity item) {
        helper.setText(R.id.select_item_content, item.getTitle());
        if (item.isSelect()){
            helper.setBackgroundRes(R.id.select_item_content,R.drawable.conversation_select_item1);
            helper.setTextColor(R.id.select_item_content,mContext.getResources().getColor(R.color.new_theme));
        }else{
            helper.setBackgroundRes(R.id.select_item_content,R.drawable.conversation_select_item);
            helper.setTextColor(R.id.select_item_content,mContext.getResources().getColor(R.color.color_1A1A1A));
        }
    }
}
